package dao;

import org.jboss.netty.util.DebugUtil;

import java.sql.Connection;
import java.sql.PreparedStatement;
import java.sql.SQLException;
import java.util.List;

public class StudentDaoImpl implements StudentDao {


    @Override
    public int addStudent(Student student) throws SQLException {
        String sql = "insert into student('Student_ID','Name','Date_of_Enrollment','Contact_Number','Semester','Student_Status')" +
                "values(?,?,?,?,?,?)";
//  连接 hbase 数据库 ， 如何连接
//        Connection connection = DebugUtil;

        PreparedStatement pstmt = null ;
        int row = 0 ;
         try  {
//              pstmt = ;
             pstmt.setString(1,student.getId());
             pstmt.setString(2,student.getName());
             pstmt.setString(3,student.getDate());
//             pstmt.setString(4,student.getNumber());
//             pstmt.setString(5,student.getSemester());
//             pstmt.setString(6,student.getStatus());
             row = pstmt.executeUpdate();
         }catch (SQLException e) {
              e.printStackTrace();
         }finally {
//
         }
         return  row;


    }
}
